<template>
    <div class="g-hd">
        <div class="hd-l">
            <div class="iconfont icon-back">&#xe624;</div>
        </div>
        <div class="hd-ipt">
            <span class="iconfont">&#xe632;</span>
            输入城市/景点/游玩主题
        </div>
        <div class="hd-r">
            <router-link to="/city">
                {{ this.nowCity }}
                <span class="iconfont icon-arrow-down">&#xe7ff;</span>
            </router-link>
        </div>
    </div>
</template>

<script>
import { mapState, mapGetters } from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city']),
    ...mapGetters(['nowCity'])
  }
}
</script>

<style lang="stylus" scoped>
    // 默认通过路径找--太长了
    // @import '../../../assets/styles/variables.styl'
    // 通过@别名找
    // @import '~@/assets/styles/variables.styl'
    // 自己创建别名找，配置webpack.base.config.js
    @import '~styles/variables.styl'
    .g-hd
        display:flex
        line-height: $headerHeight
        background: $bgColor
        // background:#00bcd4
        color:#fff
        .hd-l
            float:left
            width:.64rem
            .icon-back
                font-size .4rem
        .hd-ipt
            flex:1
            height .64rem
            line-height .64rem
            margin-top .12rem
            margin-left .2rem
            border-radius .1rem
            background:#fff
            color:#ccc
            padding-left .2rem
        .hd-r
            float:right
            min-width:1.04rem
            padding: 0 .1rem
            text-align center
            a
                color #fff
            .icon-arrow-down
                font-size .4rem
                margin-left -0.1rem
</style>
